package com.amazon.ags.jni.whispersync;

import android.util.Log;
import com.amazon.ags.api.AmazonGamesClient;
import com.amazon.ags.api.whispersync.SynchronizeBlobProgressRequest;
import com.amazon.ags.api.whispersync.SynchronizeBlobRequest;
import com.amazon.ags.api.whispersync.SynchronizeMultiFileProgressRequest;
import com.amazon.ags.api.whispersync.SynchronizeMultiFileRequest;
import com.amazon.ags.api.whispersync.WhisperSyncClient;
import com.amazon.ags.constants.whispersync.ConflictStrategy;
import java.io.IOException;

public class WhisperSyncNativeHandler
{
  private static final String TAG = WhisperSyncNativeHandler.class.getSimpleName();
  private static WhisperSyncClient m_WhisperSyncClient = null;

  private static ConflictStrategy conflictStrategyEnumToConflictStrategy(int paramInt)
  {
    switch (paramInt)
    {
    default:
      throw new IllegalArgumentException("Invalid enumeration value");
    case 0:
      return ConflictStrategy.PLAYER_SELECT;
    case 1:
      return ConflictStrategy.AUTO_RESOLVE_TO_CLOUD;
    case 2:
    }
    return ConflictStrategy.AUTO_RESOLVE_TO_IGNORE;
  }

  public static boolean hasNewMultiFileGameData()
  {
    Log.i(TAG, "IN JAVA HASNEWMULTIFILEGAMEDATA");
    return m_WhisperSyncClient.hasNewMultiFileGameData();
  }

  public static void initializeNativeHandler(AmazonGamesClient paramAmazonGamesClient)
  {
    m_WhisperSyncClient = paramAmazonGamesClient.getWhisperSyncClient();
  }

  public static void requestRevertBlob(int paramInt, long paramLong)
  {
    RevertBlobJniCallback localRevertBlobJniCallback = new RevertBlobJniCallback(paramInt, paramLong);
    m_WhisperSyncClient.requestRevert(localRevertBlobJniCallback);
  }

  public static void requestRevertMultiFile(int paramInt, long paramLong)
  {
    RevertMultiFileJniCallback localRevertMultiFileJniCallback = new RevertMultiFileJniCallback(paramInt, paramLong);
    m_WhisperSyncClient.requestRevert(localRevertMultiFileJniCallback);
  }

  public static void setFilter(String paramString, int paramInt)
  {
    m_WhisperSyncClient.setFilter(new SimpleExclusionFilter(paramString));
  }

  public static void synchronizeBlob(int paramInt, long paramLong)
  {
    SynchronizeBlobJniCallback localSynchronizeBlobJniCallback = new SynchronizeBlobJniCallback(paramInt, paramLong);
    m_WhisperSyncClient.synchronize(localSynchronizeBlobJniCallback);
  }

  public static void synchronizeBlobProgressRequest(int paramInt1, long paramLong, int paramInt2, String paramString, byte[] paramArrayOfByte)
  {
    SynchronizeBlobProgressRequest localSynchronizeBlobProgressRequest = new SynchronizeBlobProgressRequest(new SynchronizeBlobJniCallback(paramInt1, paramLong));
    localSynchronizeBlobProgressRequest.setConflictStrategy(conflictStrategyEnumToConflictStrategy(paramInt2));
    localSynchronizeBlobProgressRequest.setDescription(paramString);
    localSynchronizeBlobProgressRequest.setData(paramArrayOfByte);
    m_WhisperSyncClient.synchronizeProgress(localSynchronizeBlobProgressRequest);
  }

  public static void synchronizeBlobRequest(int paramInt1, long paramLong, int paramInt2)
  {
    SynchronizeBlobRequest localSynchronizeBlobRequest = new SynchronizeBlobRequest(new SynchronizeBlobJniCallback(paramInt1, paramLong));
    localSynchronizeBlobRequest.setConflictStrategy(conflictStrategyEnumToConflictStrategy(paramInt2));
    m_WhisperSyncClient.synchronize(localSynchronizeBlobRequest);
  }

  public static void synchronizeMultiFile(int paramInt, long paramLong)
  {
    SynchronizeMultiFileJniCallback localSynchronizeMultiFileJniCallback = new SynchronizeMultiFileJniCallback(paramInt, paramLong);
    m_WhisperSyncClient.synchronize(localSynchronizeMultiFileJniCallback);
  }

  public static void synchronizeMultiFileProgressRequest(int paramInt1, long paramLong, int paramInt2, String paramString1, String paramString2)
  {
    SynchronizeMultiFileProgressRequest localSynchronizeMultiFileProgressRequest = new SynchronizeMultiFileProgressRequest(new SynchronizeMultiFileJniCallback(paramInt1, paramLong));
    localSynchronizeMultiFileProgressRequest.setConflictStrategy(conflictStrategyEnumToConflictStrategy(paramInt2));
    localSynchronizeMultiFileProgressRequest.setDescription(paramString1);
    localSynchronizeMultiFileProgressRequest.setFilter(new SimpleExclusionFilter(paramString2));
    m_WhisperSyncClient.synchronizeProgress(localSynchronizeMultiFileProgressRequest);
  }

  public static void synchronizeMultiFileRequest(int paramInt1, long paramLong, int paramInt2)
  {
    SynchronizeMultiFileRequest localSynchronizeMultiFileRequest = new SynchronizeMultiFileRequest(new SynchronizeMultiFileJniCallback(paramInt1, paramLong));
    localSynchronizeMultiFileRequest.setConflictStrategy(conflictStrategyEnumToConflictStrategy(paramInt2));
    m_WhisperSyncClient.synchronize(localSynchronizeMultiFileRequest);
  }

  public static void unpackNewMultiFileGameData()
    throws IOException
  {
    m_WhisperSyncClient.unpackNewMultiFileGameData();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.amazon.ags.jni.whispersync.WhisperSyncNativeHandler
 * JD-Core Version:    0.6.2
 */